package com.yanqu.road.server.manger.activity.patronsfund;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.enums.eActivityType;
import com.yanqu.road.server.TempMgr;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.activity.NormalActivityMgr;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import org.apache.mina.util.ConcurrentHashSet;

import java.util.List;
import java.util.Set;

public class PatronsFundMgr extends TempMgr {

    /**
     * 门客ID集合
     */
    private static Set<Integer> partnerIds = new ConcurrentHashSet<>();

    @Override
    public boolean init() throws Exception {
        return false;
    }

    @Override
    public boolean reloadConfig() throws Exception {
        return false;
    }

    @Override
    public boolean reloadData() throws Exception {
        return false;
    }

    @Override
    public boolean stop() {
        return false;
    }

    /**
     * 加载活动
     */
    public static void reloadActivityData(){
        getLogger().info("reload PatronsFundMgr Activity start");
        // 活动信息 activityInfo
        List<ActivityInfo> openActivityInfoList = NormalActivityMgr.getOpenActivityInfoList(eActivityType.PatronsFund.getValue());
        if (openActivityInfoList.isEmpty()) {
            getLogger().info("no PatronsFundMgr Activity in show time");
            return;
        }
        for (ActivityInfo activityInfo : openActivityInfoList) {
            partnerIds.add(activityInfo.getChildType());
        }
    }

    /**
     * 获取参与基金的门客ID集合
     * @return Set<Integer>
     */
    public static Set<Integer> getPartnerIds() {
        return partnerIds;
    }
}
